<template>
  <div>
    <BoxSkin
      v-for="item in list"
      d-flex-center
      style="align-items: normal;overflow: hidden;"
      bor-7
      mx-10
      my-10
    >
      <Magazine
        :image="item.image"
        style="height: 100px; width: 100px"
        bor-7
      ></Magazine>
      <div px-10 py-10 style="flex: 1">
        <div fz-14>{{ item.title }}</div>
        <div class="progress" d-flex-center my-10>
          <div class="progress__inner">
            <div
              class="progress__outer"
              :style="{
                width: Math.floor(Math.random() * (100 - 10 + 1) + 12) + '%',
              }"
            ></div>
          </div>
          <div class="progress__text" ml-10>剩余{{ item.progress }}件</div>
        </div>
        <div class="price" d-flex-center style="justify-content: space-between">
          <div>
            <span class="price__current" fz-15 mr-2 style="color: #9a3e49"
              >￥{{ item.price }}</span
            >
            <span class="price__old">￥{{ item.oldprice }}</span>
          </div>
          <div class="price__buy" px-10 py-5 bor-10 text-tertiary>立即购买</div>
        </div>
        <div class="tips" text-secondary ellipsis-1>
          {{ item.tips }}
        </div>
      </div>
    </BoxSkin>
  </div>
</template>

<script setup lang="ts">
import BoxSkin from "@/components/box-skin/BoxSkin.vue";
import Magazine from "@/components/magazine/Magazine.vue";
defineProps({
  list: {
    type: Array,
    default: () => [],
  },
});
</script>

<style scoped lang="scss">
@include b(progress) {
  @include e(inner) {
    width: 60%;
    height: 16px;
    background-color: #fdd8e1;
    border-radius: 8px;
  }
  @include e(outer) {
    height: 100%;
    background-color: #ff3366;
    border-radius: 8px;
  }
  @include e(text) {
    font-size: 12px;
  }
}
@include b(price) {
  @include e(buy) {
    background-color: #e1505f;
  }
}
</style>
